//
//  UIImage+ImageOriginal.m
//
//  Created by Laki on 16/5/25.
//  Copyright © 2016年 SG. All rights reserved.
//

#import "UIImage+ImageOriginal.h"

@implementation UIImage (ImageOriginal)
+ (UIImage *)imageWithOriginal:(UIImage *)image{
    return [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}

- (UIImage *)circularImage{
    UIGraphicsBeginImageContextWithOptions(self.size, NO, 0);
    UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, self.size.width, self.size.height)];
    
    [path addClip];
    
    [self drawAtPoint:CGPointZero];
    
    UIImage *imageView = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    return imageView;
}
@end
